import request from '@/utils/request'

// 全部商品类型列表
export const getGoodsType = (pageIndex, pageSize) => {
  return request({
    url: '/api/vm-service/skuClass/search',
    method: 'get',
    params: {
      pageIndex,
      pageSize
    }
  })
}
// 新增商品类型
export const addGoodsType = (data) => {
  return request({
    url: '/api/vm-service/skuClass',
    method: 'POST',
    data
  })
}
// 修改商品类型
export const editGoodsType = (id, className) => {
  return request({
    url: '/api/vm-service/skuClass/' + id,
    method: 'PUT',
    data: {
      className
    }
  })
}

// 删除商品类型
export const delGoodsType = (id) => {
  return request({
    url: '/api/vm-service/skuClass/' + id,
    method: 'DELETE'
  })
}

// 商品类型搜索
export const searchGoodsType = (className) => {
  return request({
    url: '/api/vm-service/skuClass/search',
    method: 'GET',
    params: {
      className
    }
  })
}
// 商品数据导入
export const getGoods = (params) => {
  return request({
    url: '/api/vm-service/sku/search',
    method: 'GET',
    params
  })
}
// 商品信息搜索
// export const searchGoods = (params) => {
//   return request({
//     url: '/api/vm-service/sku/search',
//     method: 'GET',
//     params
//   })
// }
// 修改商品详情
export const editGoods = (id, data) => {
  return request({
    url: '/api/vm-service/sku/' + id,
    method: 'PUT',
    data
  })
}
// 新增商品
export const addGoods = (data) => {
  return request({
    url: '/api/vm-service/sku',
    method: 'POST',
    data
  })
}

// 商品图片上传
// export const uploadImg = (fileName) => {
//   return request({
//     url: '/api/vm-service/sku/fileUpload',
//     method: 'POST',
//     data: {
//       fileName
//     }
//   })
// }
